import $ from "jquery";
import "./header-nav.css";
import headerNav from "./header-nav.tpl";

import {tplReplace} from "../../../utils/tools";

export default (navData)=>{
    return{
        name:"header-nav",
        tpl(){

            let str = "";
            $(navData).each(function(i,v){
                str += tplReplace(headerNav(),{
                    fieldId:v.fieldId,
                    fieldName:v.fieldName
                })
            });
            return `<div class='nav'>${str}</div>`;
        }
    }
}
